/**
 * Teacher Class
 * Use to create a teacher object
 *
 *  @author John Thomason
 *  Date: Fall 2008
 *  Course: CS222
 *  Seminar: 6
 *  Assign: Final Exam Part B
 *
 */
public class Teacher extends Person {

//INSTANCE VARIABLES

    private double         salary;
    private double         hoursWorked;
    private School.Degree  degree;
    private School.Subject subjectTaught;

    
//CONSTRUCTORS

    private Teacher (){} //no default teacher; must pass args
    /**
     * Teacher Constructor
     * @param name          The teacher name
     * @param age           The teacher age
     * @param degree        The degree held
     * @param subject       The subject taught
     * @param salary        The required salary
     * @param hoursWorked   The hours worked weekly
     */
    public Teacher (String name, int age, School.Degree degree,
                    School.Subject subject, double salary, double hoursWorked){
        super(name, age);
        this.degree        = degree;
        this.subjectTaught = subject;
        this.salary        = salary;
        this.hoursWorked   = hoursWorked;
    }//Constuctors


//REQUIRED METHODS

    /**
     * Information about what the teacher teaches
     * @return  A string with name, age, and subject information
     */
    public String teach () {
        return String.format("\nTeacher:\n  %s\n  Subject Taught: %s\n",
                              super.toString(),              
                              subjectTaught.name()
                            );
    }//teach()

    /**
     * Detailed information about this teacher
     * @return  A formatted string of detailed information
     */
    public String personDetails () {
        return String.format("%s\n  Degree: %s in %s" +
                               "\n  Salary: $%.2f" +
                               "\n  Hours: %.2f per week\n\n",
                              super.toString(),
                              degree.name(), subjectTaught.name(),
                              salary, hoursWorked
                             );
    }//personDetails()

    
//OVERRIDDEN METHODS

    /**
     * A formatted string of detailed teacher information
     * @return  The formatted string of information
     */
    @Override
    public String toString () {
        return personDetails();
    }//toString()

}//Teacher Class

